import VeeValidate from 'vee-validate'
import zh_CN from 'vee-validate/dist/locale/zh_CN'
export default function(Vue){
    Vue.use(VeeValidate)
    VeeValidate.Validator.localize("zh_CN",{
        messages:{
            ...zh_CN.messages,
            regex:(m)=>`${m}的值不符合我定义的正则`,
            is:(m)=>`${m}的值必须和密码一致`
        },
          // 对字段进行中文名的配置
    attributes:{
        phone:"手机号",
        code:"验证码",
        password:"密码",
        passAgain:"确认密码" ,
        agree:'协议'
    }
    },
  

    )
    VeeValidate.Validator.extend('agree',{
        validate:(value)=>{
            return value
        },
        getMessage:(m)=>{
            return `${m}必须同意`
        }
    })

}